/*
 * Copyright (c) 2014-2021 Contributors to the Eclipse Foundation
 * 
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 * 
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 * 
 * SPDX-License-Identifier: EPL-2.0
 */

const char * default_topic_rules =
"/*\n"
" * Define the client mapping rules.\n"
" * The client class must be a single character or default.\n"
" * Allowed variables are: Org, Type, and Id.  Unset variables will be null.\n"
" * This can be defined for each\n"
" */\n"
" {\n"
"\"ClientClass\": {\n"
"    \"iot2\": {\n"
"        \"d\": \"d:{Org}:{Type}:{Id}\",\n"
"        \"a\": \"1,a:{Org}:{Id}\",\n"
"        \"A\": \"1,A:{Org}:{Id}\",\n"
"        \"A\": \"1,A:{Org}:{Id}:{Inst}\",\n"
"        \"g\": \"g:{Org}:{Type}:{Id}\",\n"
"        \"default\": null,             /* Client ID not matching rules is not allowed */\n"
"    }\n"
"},\n"
"\n"
"\"Authentication\": {\n"
"    \"event_send\":     1,\n"
"    \"event_recv\":     2,\n"
"    \"cmd_send\":       4,\n"
"    \"cmd_recv\":       8,\n"
"    \"dm_protocol\":   32,\n"
"    \"dm_status\":    128\n"
"},\n"
"\n"
"/*\n"
" * Define the topic rules.\n"
" * + = any character including + wildcard but not zero length\n"
" * * = any character including wildcards and slashes\n"
" * ~ = any character except + wildcard but not zero length\n"
" * {var} = Must match specified variable: Org, Type, or Id\n"
" */\n"
"\"TopicRule\": {\n"
"    \"iot2\": {\n"
"        /* iot2 device */\n"
"        \"d\": {\n"
"            \"subscribe\": [\n"
"                \"iot-2/cmd/+/fmt/+; @cmd_recv\",\n"
"                \"iotdm-1/*; @dm_protocol\",\n"
"                \"iot-2/mon; @dm_status\",\n"
"                \"iot-2/notify\"\n"
"            ],\n"
"            \"publish\": [\n"
"                \"iot-2/evt/~/fmt/~; @event_send\",\n"
"                \"iotdevice-1/response; @dm_protocol\",\n"
"                \"iotdevice-1/notify; @dm_protocol\",\n"
"                \"iotdevice-1/device/update/~; @dm_protocol\",\n"
"                \"iotdevice-1/add/~/~; @dm_protocol\",\n"
"                \"iotdevice-1/clear/~/~; @dm_protocol\",\n"
"                \"iotdevice-1/mgmt/~; @dm_protocol\",\n"
"            ],\n"
"            \"convert\":  \"1,{Org}/type/{Type}/id/{Id}/\",  /* Add Org, type, and device after first slash */\n"
"            \"nohash\": false                               /* Do not allow # character  */\n"
"        },\n"
"        /* iot2 GW */\n"
"        \"g\": {\n"
"            \"subscribe\": [\n"
"                \"iot-2/type/+/id/+/cmd/+/fmt/+; @cmd_recv\",\n"
"                \"iot-2/type/+/id/+/response\",\n"
"                \"iot-2/type/+/id/+/notify\",\n"
"                \"iotdm-1/*; @dm_protocol\",\n"
"                \"iot-2/mon; @dm_status\"\n"
"            ],\n"
"            \"publish\": [\n"
"                \"iot-2/type/~/id/~/evt/~/fmt/~; @event_send\",\n"
"                \"iotdevice-1/type/~/id/~/response; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/notify; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/device/update/~; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/add/~/~; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/clear/~/~;@dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/mgmt/~;dm_protocol\",\n"
"            ],\n"
"            \"convert\":  \"1,{Org}/\",  /* Add Org, type, and device after first slash */\n"
"            \"nohash\": false                               /* Do not allow # character  */\n"
"        },\n"
"        /* iot2 Connector */\n"
"        \"c\": {\n"
"            \"subscribe\": [\n"
"                \"iot-2/type/+/id/+/cmd/+/fmt/+; @cmd_recv\",\n"
"                \"iot-2/type/+/id/+/response\",\n"
"                \"iot-2/type/+/id/+/notify\",\n"
"                \"iotdm-1/*; @dm_protocol\",\n"
"                \"iot-2/mon; @dm_status\"\n"
"            ],\n"
"            \"publish\": [\n"
"                \"iot-2/type/~/id/~/evt/~/fmt/~; @event_send\",\n"
"                \"iotdevice-1/type/~/id/~/response; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/notify; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/device/update/~; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/add/~/~; @dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/clear/~/~;@dm_protocol\",\n"
"                \"iotdevice-1/type/~/id/~/mgmt/~;dm_protocol\",\n"
"            ],\n"
"            \"convert\":  \"1,{Org}/\",  /* Add Org, type, and device after first slash */\n"
"            \"nohash\": false                               /* Do not allow # character  */\n"
"        },\n"
"        /* iot2 application */\n"
"        \"a\": {\n"
"            \"subscribe\": [\n"
"                \"iot-2/type/+/id/+/evt/+/fmt/+; @event_recv\",\n"
"                \"iot-2/type/+/id/+/cmd/+/fmt/+; @cmd_recv\",\n"
"                \"iot-2/type/+/id/+/mon; @dm_status\",\n"
"                \"iot-2/app/+/mon; @dm_status\"\n"
"            ],\n"
"            \"publish\": [\n"
"                \"iot-2/type/~/id/~/evt/~/fmt/~; @event_send\",\n"
"                \"iot-2/type/~/id/~/cmd/~/fmt/~; @cmd_send\"\n"
"            ],\n"
"            \"convert\":  \"1,{Org}/\",                      /* Add Org after first slash */\n"
"            \"nohash\": true                               /* Do not allow # character  */\n"
"        },\n"
"        \"A\": {\n"
"            \"subscribe\": [\n"
"                \"iot-2/type/+/id/+/evt/+/fmt/+; @event_recv\",\n"
"                \"iot-2/type/+/id/+/cmd/+/fmt/+; @cmd_recv\",\n"
"                \"iot-2/type/+/id/+/mon; @dm_status\",\n"
"                \"iot-2/app/+/mon; @dm_status\"\n"
"            ],\n"
"            \"publish\": [\n"
"                \"iot-2/type/~/id/~/evt/~/fmt/~; @event_send\",\n"
"                \"iot-2/type/~/id/~/cmd/~/fmt/~; @cmd_send\"\n"
"            ],\n"
"            \"convert\":  \"1,{Org}/\",                      /* Add Org after first slash */\n"
"            \"nohash\": true                               /* Do not allow # character  */\n"
"        }\n"
"    },\n"
"\n"
"\n"
"    \"quickstart2\": {\n"
"        /* quickstart device */\n"
"        \"d\": {\n"
"            \"subscribe\": null,\n"
"            \"publish\": [\n"
"                \"iot-2/evt/~/fmt/json\",\n"
"                \"iot-dm/client/request/~/fmt/~\",\n"
"                \"iot-dm/server/response/~/fmt/~\"\n"
"            ],\n"
"            \"convert\":  \"1,{Org}/type/{Type}/id/{Id}/\",  /* Add Org, type, and device after first slash */\n"
"            \"nohash\": true                               /* Do not allow # character  */\n"
"        },\n"
"        /* quickstart application */\n"
"        \"a\": {\n"
"            \"subscribe\": [\n"
"                \"iot-2/type/+/id/~/evt/+/fmt/+\",\n"
"                \"iot-2/type/+/id/~/mon\",\n"
"                \"iot-2/app/~/mon\"\n"
"            ],\n"
"            \"publish\": [\n"
"                \"iot-2/type/~/id/~/evt/~/fmt/~\"\n"
"            ],\n"
"            \"convert\":  \"1,{org}/\",                      /* Add Org after first slash */\n"
"            \"nohash\": true                               /* Do not allow # character  */\n"
"        }\n"
"    },\n"
"\n"
"    /* Default if no ruleset is specified */\n"
"    \"default\": {\n"
"    }\n"
"}\n"
"}\n"
"\n"
;
